The present invention relates to a semiconductor device, and is used suitably for a semiconductor device such as a microcomputer which includes a nonvolatile memory.
As a storing system of a nonvolatile memory, there are a system in which data of “1” or “0” is stored in each memory cell (for example, refer to Japanese Unexamined Patent Application Publication No. 2004-318941 (Patent Document 1)) and a system in which complementary data of “1” and “0” are stored in a pair of memory cells (for example, refer to Japanese Unexamined Patent Application Publication No. 2008-117510 (Patent Document 2)). In the former system, data of a memory cell is read by comparing a current which flows through the memory cell with a reference current (hereinafter called a reference current reading system). In the latter system, data of a memory cell pair is read by comparing currents which flow through the memory cells configuring the pair (hereinafter called a complementary reading system).
Compared with the complementary reading system, the reference current reading system has a fast read speed and is capable of increasing the storage capacity (capable of decreasing the memory size). However, the reference current reading system has a demerit that the rewritable count is small compared with the complementary reading system, since it is necessary to fully erase the memory cell. Therefore, the reference current reading system is used in the code area where rewrite does not take place frequently.
On the other hand, compared with the reference current reading system, the complementary reading system has a small storage capacity (a large memory size); however the complementary reading system is capable of reducing the read current and increasing the rewritable count. Therefore, the complementary reading system is used in the data area where rewrite takes place frequently.
Freescale Semiconductor, Inc. provides a processor which mounts an on-chip flash memory with the function of EEE (Enhanced EEPROM) (refer to Non-patent Document 1). The flash memory with the EEE function concerned can select the case where priority is given to the reduction of memory size, and the case where priority is given to the retention (holding capability). However, its concrete hardware configuration is unknown.